

set more off
global code "N:\GrpHOBAHE\dofile"

*****************************************************
*****************************************************
***Prepare data******************************
*****************************************************
*****************************************************

*clean patent data
do "$code\clean_patent.do"

*clean CFDA codes and generate funding sources
do "$code\clean_data.do"

*combine with the publications data
do "$code\clean_publication.do"

*get negative funding shocks & produce Figure 2
do "$code\shocks.do"

*impute PI
do "$code\pi.do"

*****************************************************
*****************************************************
***Analysis******************************
*****************************************************
*****************************************************

*summary stats (Table 1 & 8)
do "$code\summ_stats.do"

*run diff-in-diff regressions using baseline negative shocks
*produce Table 2, 3, 4, 5, 7, A1, A4, A5, A6, Figure 3, 5, 6, 7, 9, A5
do "$code\diff_in_diff.do"

*grant timing (Table 6)
do "$code\grant_expiration_duration.do"

*placebo test (Figure 8)
do "$code\placebo_patent.do"

*robustness using positive shocks (Table A3)
do "$code\positive_shock.do"
